#include <stdio.h>

int main(int argc, char *argv[]) {
  int flag = 0;
  int left, right;

  do {
    scanf("%d %d", &left, &right);
    if (right) {
      if (flag) printf(" ");
      printf("%d %d", left * right, right - 1);
      flag = 1;
    }
  } while (getchar() != '\n');

  if (flag == 0) printf("0 0");

  return 0;
}
